const express = require('express');
const router = express.Router();
let count = 1;

router.get('/rate', (req, res) => {
    const content = [
        {
            month: '2019年4月',
            variety: 719,
            deliveryVariety: 116,
            rate: 16.13
        },
        {
            month: '2019年5月',
            variety: 603,
            deliveryVariety: 155,
            rate: 20.00
        },
        {
            month: '2019年6月',
            variety: 584,
            deliveryVariety: 120,
            rate: 30.10
        },
        {
            month: '2019年7月',
            variety: 564,
            deliveryVariety: 237,
            rate: 42.02
        },
        {
            month: '2019年8月',
            variety: 402,
            deliveryVariety: 288,
            rate: 50.75
        },
        {
            month: '2019年9月',
            variety: 431,
            deliveryVariety: 300,
            rate: '69.61%'
        },
        {
            month: '2019年10月',
            variety: 336,
            deliveryVariety: 250,
            rate: 74.21
        },
        {
            month: '2019年11月',
            variety: 295,
            deliveryVariety: 230,
            rate: 77.91
        },
        {
            month: '2019年12月',
            variety: 247,
            deliveryVariety: 200,
            rate: 80.11
        },
        {
            month: '2020年1月',
            variety: 227,
            deliveryVariety: 190,
            rate: 83.91
        },
        {
            month: '2020年2月',
            variety: 171,
            deliveryVariety: 150,
            rate: 87.46
        },
        {
            month: '2020年3月',
            variety: 139,
            deliveryVariety: 130,
            rate: 95.53
        },
    ];
    res.json({
        message: '',
        payload: {
            content
        }
    });
});

router.get('/type', (req, res) => {
    const content = [
        {
            type: '确定交付时间',
            month: '2019-04',
            value: 343
        },
        {
            type: '确定交付时间',
            month: '2019-05',
            value: 316
        },
        {
            type: '确定交付时间',
            month: '2019-06',
            value: 296
        },
        {
            type: '确定交付时间',
            month: '2019-07',
            value: 160
        },
        {
            type: '确定交付时间',
            month: '2019-08',
            value: 134
        },
        {
            type: '确定交付时间',
            month: '2019-09',
            value: 148
        },
        {
            type: '确定交付时间',
            month: '2019-10',
            value: 135
        },
        {
            type: '确定交付时间',
            month: '2019-11',
            value: 123
        },
        {
            type: '确定交付时间',
            month: '2019-12',
            value: 112
        },
        {
            type: '确定交付时间',
            month: '2020-01',
            value: 96
        },
        {
            type: '确定交付时间',
            month: '2019-02',
            value: 87
        },
        {
            type: '确定交付时间',
            month: '2020-03',
            value: 88
        },
        {
            type: '替代方案',
            month: '2019-04',
            value: 137
        },
        {
            type: '替代方案',
            month: '2019-05',
            value: 135
        },
        {
            type: '替代方案',
            month: '2019-06',
            value: 122
        },
        {
            type: '替代方案',
            month: '2019-07',
            value: 111
        },
        {
            type: '替代方案',
            month: '2019-08',
            value: 104
        },
        {
            type: '替代方案',
            month: '2019-09',
            value: 86
        },
        {
            type: '替代方案',
            month: '2019-10',
            value: 78
        },
        {
            type: '替代方案',
            month: '2019-11',
            value: 52
        },
        {
            type: '替代方案',
            month: '2019-12',
            value: 52
        },
        {
            type: '替代方案',
            month: '2020-01',
            value: 48
        },
        {
            type: '替代方案',
            month: '2019-02',
            value: 35
        },
        {
            type: '替代方案',
            month: '2020-03',
            value: 343
        },
        {
            type: '待确定时间',
            month: '2019-04',
            value: 140
        },
        {
            type: '待确定时间',
            month: '2019-05',
            value: 89
        },
        {
            type: '待确定时间',
            month: '2019-06',
            value: 88
        },
        {
            type: '待确定时间',
            month: '2019-07',
            value: 55
        },
        {
            type: '待确定时间',
            month: '2019-08',
            value: 77
        },
        {
            type: '待确定时间',
            month: '2019-09',
            value: 75
        },
        {
            type: '待确定时间',
            month: '2019-10',
            value: 74
        },
        {
            type: '待确定时间',
            month: '2019-11',
            value: 58
        },
        {
            type: '待确定时间',
            month: '2019-12',
            value: 58
        },
        {
            type: '待确定时间',
            month: '2020-01',
            value: 45
        },
        {
            type: '待确定时间',
            month: '2019-02',
            value: 35
        },
        {
            type: '待确定时间',
            month: '2020-03',
            value: 30
        },
        {
            type: '待确定方案',
            month: '2019-04',
            value: 98
        },
        {
            type: '待确定方案',
            month: '2019-05',
            value: 78
        },
        {
            type: '待确定方案',
            month: '2019-06',
            value: 77
        },
        {
            type: '待确定方案',
            month: '2019-07',
            value: 66
        },
        {
            type: '待确定方案',
            month: '2019-08',
            value: 56
        },
        {
            type: '待确定方案',
            month: '2019-09',
            value: 45
        },
        {
            type: '待确定方案',
            month: '2019-10',
            value: 40
        },
        {
            type: '待确定方案',
            month: '2019-11',
            value: 35
        },
        {
            type: '待确定方案',
            month: '2019-12',
            value: 30
        },
        {
            type: '待确定方案',
            month: '2020-01',
            value: 23
        },
        {
            type: '待确定方案',
            month: '2019-02',
            value: 15
        },
        {
            type: '待确定方案',
            month: '2020-03',
            value: 11
        }
    ];
    res.json({
        message: '',
        payload: {
            content
        }
    });
});

router.get('/week', (req, res) => {
    count += 1;
    const content = {
        isFirstQty: !(count % 2),
        fridayOne: '2020-05-01T02:37:44.918Z',
        fridayTwo: '2020-05-08T02:37:44.918Z',
        fridayThree: '2020-05-15T02:37:44.918Z',
        fridayFour: '2020-05-22T02:37:44.918Z',
        fridayFive: '2020-05-29T02:37:44.918Z',
        fridayOneLast: '2020-04-24T02:37:44.918Z',
        weekDetails: [
            {
                dealerCode: '15665',
                country: '巴西',
                channel: 1,
                type: '4月份到货',
                n1WeekNumber: 1,
                n2WeekNumber: 2,
                n3WeekNumber: 3,
                n4WeekNumber: 4,
            }, {
                dealerCode: '15665',
                country: '巴西',
                channel: 1,
                type: '5月份到货',
                n1WeekNumber: 1,
                n2WeekNumber: 2,
                n3WeekNumber: 3,
                n4WeekNumber: 4,
            }, {
                dealerCode: '15665',
                country: '巴西',
                channel: 1,
                type: '6月份到货',
                n1WeekNumber: 1,
                n2WeekNumber: 2,
                n3WeekNumber: 3,
                n4WeekNumber: 4,
            }, {
                dealerCode: '15665',
                country: '巴西',
                channel: 1,
                type: '替代方案',
                n1WeekNumber: 1,
                n2WeekNumber: 2,
                n3WeekNumber: 3,
                n4WeekNumber: 4,
            }, {
                dealerCode: '15665',
                country: '巴西',
                channel: 1,
                type: '待确定时间',
                n1WeekNumber: 1,
                n2WeekNumber: 2,
                n3WeekNumber: 3,
                n4WeekNumber: 4,
            }, {
                dealerCode: '15665',
                country: '巴西',
                channel: 1,
                type: '待确定方案',
                n1WeekNumber: 1,
                n2WeekNumber: 2,
                n3WeekNumber: 3,
                n4WeekNumber: 4,
            }
        ],
        fistWeekDetails: [
            {
                dealerCode: '15665',
                country: '巴西',
                channel: 1,
                type: '4月份到货',
                lastWeekNumber: 1,
                weekNumber: 2,
                newNumber: 3,
                totalNumber: 4,
            }, {
                dealerCode: '15665',
                country: '巴西',
                channel: 1,
                type: '5月份到货',
                lastWeekNumber: 1,
                weekNumber: 2,
                newNumber: 3,
                totalNumber: 4,
            }, {
                dealerCode: '15665',
                country: '巴西',
                channel: 1,
                type: '6月份到货',
                lastWeekNumber: 1,
                weekNumber: 2,
                newNumber: 3,
                totalNumber: 4,
            }, {
                dealerCode: '15665',
                country: '巴西',
                channel: 1,
                type: '替代方案',
                lastWeekNumber: 1,
                weekNumber: 2,
                newNumber: 3,
                totalNumber: 4,
            }, {
                dealerCode: '15665',
                country: '巴西',
                channel: 1,
                type: '待确定时间',
                lastWeekNumber: 1,
                weekNumber: 2,
                newNumber: 3,
                totalNumber: 4,
            }, {
                dealerCode: '15665',
                country: '巴西',
                channel: 1,
                type: '待确定方案',
                lastWeekNumber: 1,
                weekNumber: 2,
                newNumber: 3,
                totalNumber: 4,
            }, {
                dealerCode: '15665',
                country: '巴西',
                channel: 1,
                type: '合计',
                lastWeekNumber: 6,
                weekNumber: 12,
                newNumber: 18,
                totalNumber: 36,
            }
        ]
    };
    res.json({
        message: '',
        payload: {
            content
        }
    });
});

router.get('/month', (req, res) => {
    const content = [
        {
            channel: 1,
            type: '确定交付时间',
            n1MonthNumber: 1,
            n2MonthNumber: 2,
            n3MonthNumber: 3,
            n4MonthNumber: 4,
            n5MonthNumber: 5,
            n6MonthNumber: 6,
            n7MonthNumber: 7,
            n8MonthNumber: 8,
            n9MonthNumber: 9,
            n10MonthNumber: 10,
            n11MonthNumber: 11,
            n12MonthNumber: 12,
        },
        {
            channel: 1,
            type: '替代方案',
            n1MonthNumber: 1,
            n2MonthNumber: 2,
            n3MonthNumber: 3,
            n4MonthNumber: 4,
            n5MonthNumber: 5,
            n6MonthNumber: 6,
            n7MonthNumber: 7,
            n8MonthNumber: 8,
            n9MonthNumber: 9,
            n10MonthNumber: 10,
            n11MonthNumber: 11,
            n12MonthNumber: 12,
        },
        {
            channel: 1,
            type: '待确定时间',
            n1MonthNumber: 1,
            n2MonthNumber: 2,
            n3MonthNumber: 3,
            n4MonthNumber: 4,
            n5MonthNumber: 5,
            n6MonthNumber: 6,
            n7MonthNumber: 7,
            n8MonthNumber: 8,
            n9MonthNumber: 9,
            n10MonthNumber: 10,
            n11MonthNumber: 11,
            n12MonthNumber: 12,
        },
        {
            channel: 1,
            type: '待确定方案',
            n1MonthNumber: 1,
            n2MonthNumber: 2,
            n3MonthNumber: 3,
            n4MonthNumber: 4,
            n5MonthNumber: 5,
            n6MonthNumber: 6,
            n7MonthNumber: 7,
            n8MonthNumber: 8,
            n9MonthNumber: 9,
            n10MonthNumber: 10,
            n11MonthNumber: 11,
            n12MonthNumber: 12,
        },
        {
            channel: 1,
            type: '合计',
            n1MonthNumber: 1,
            n2MonthNumber: 2,
            n3MonthNumber: 3,
            n4MonthNumber: 4,
            n5MonthNumber: 5,
            n6MonthNumber: 6,
            n7MonthNumber: 7,
            n8MonthNumber: 8,
            n9MonthNumber: 9,
            n10MonthNumber: 10,
            n11MonthNumber: 11,
            n12MonthNumber: 12,
        },
        {
            channel: 1,
            type: '交付品种数',
            n1MonthNumber: 1,
            n2MonthNumber: 2,
            n3MonthNumber: 3,
            n4MonthNumber: 4,
            n5MonthNumber: 5,
            n6MonthNumber: 6,
            n7MonthNumber: 7,
            n8MonthNumber: 8,
            n9MonthNumber: 9,
            n10MonthNumber: 10,
            n11MonthNumber: 11,
            n12MonthNumber: 12,
        },
        {
            channel: 1,
            type: '满足率',
            n1MonthNumber: 0.1,
            n2MonthNumber: 0.2,
            n3MonthNumber: 0.3,
            n4MonthNumber: 0.4,
            n5MonthNumber: 0.5,
            n6MonthNumber: 0.6,
            n7MonthNumber: 0.7,
            n8MonthNumber: 0.8,
            n9MonthNumber: 0.9,
            n10MonthNumber: 0.91,
            n11MonthNumber: 0.92,
            n12MonthNumber: 0.95,
        }
    ];
    res.json({
        message: '',
        payload: {
            content
        }
    });
});

router.get('/country', (req, res) => {
    const content = [
        {
            id: '1',
            country: '巴西',
            details: [
                {
                    channel: 1,
                    type: '确定交付时间',
                    n1MonthNumber: 1,
                    n2MonthNumber: 2,
                    n3MonthNumber: 3,
                    n4MonthNumber: 4,
                    n5MonthNumber: 5,
                    n6MonthNumber: 6,
                },
                {
                    channel: 1,
                    type: '替代方案',
                    n1MonthNumber: 1,
                    n2MonthNumber: 2,
                    n3MonthNumber: 3,
                    n4MonthNumber: 4,
                    n5MonthNumber: 5,
                    n6MonthNumber: 6,
                },
                {
                    channel: 1,
                    type: '待确定时间',
                    n1MonthNumber: 1,
                    n2MonthNumber: 2,
                    n3MonthNumber: 3,
                    n4MonthNumber: 4,
                    n5MonthNumber: 5,
                    n6MonthNumber: 6,
                },
                {
                    channel: 1,
                    type: '待确定方案',
                    n1MonthNumber: 1,
                    n2MonthNumber: 2,
                    n3MonthNumber: 3,
                    n4MonthNumber: 4,
                    n5MonthNumber: 5,
                    n6MonthNumber: 6,
                },
                {
                    channel: 1,
                    type: '合计',
                    n1MonthNumber: 1,
                    n2MonthNumber: 2,
                    n3MonthNumber: 3,
                    n4MonthNumber: 4,
                    n5MonthNumber: 5,
                    n6MonthNumber: 6,
                },
                {
                    channel: 1,
                    type: '交付品种数',
                    n1MonthNumber: 1,
                    n2MonthNumber: 2,
                    n3MonthNumber: 3,
                    n4MonthNumber: 4,
                    n5MonthNumber: 5,
                    n6MonthNumber: 6,
                },
                {
                    channel: 1,
                    type: '满足率',
                    n1MonthNumber: 0.1,
                    n2MonthNumber: 0.2,
                    n3MonthNumber: 0.3,
                    n4MonthNumber: 0.4,
                    n5MonthNumber: 0.5,
                    n6MonthNumber: 0.6,
                }
            ],
            detailRates: [
                {
                    month: '2019年10月',
                    variety: 336,
                    deliveryVariety: 250,
                    rate: 74.21
                },
                {
                    month: '2019年11月',
                    variety: 295,
                    deliveryVariety: 230,
                    rate: 77.91
                },
                {
                    month: '2019年12月',
                    variety: 247,
                    deliveryVariety: 200,
                    rate: 80.11
                },
                {
                    month: '2020年1月',
                    variety: 227,
                    deliveryVariety: 190,
                    rate: 83.91
                },
                {
                    month: '2020年2月',
                    variety: 171,
                    deliveryVariety: 150,
                    rate: 87.46
                },
                {
                    month: '2020年3月',
                    variety: 139,
                    deliveryVariety: 130,
                    rate: 95.53
                },
            ]
        },
        {
            id: '2',
            country: '俄罗斯',
            details: [
                {
                    channel: 1,
                    type: '确定交付时间',
                    n1MonthNumber: 1,
                    n2MonthNumber: 2,
                    n3MonthNumber: 3,
                    n4MonthNumber: 4,
                    n5MonthNumber: 5,
                    n6MonthNumber: 6,
                },
                {
                    channel: 1,
                    type: '替代方案',
                    n1MonthNumber: 1,
                    n2MonthNumber: 2,
                    n3MonthNumber: 3,
                    n4MonthNumber: 4,
                    n5MonthNumber: 5,
                    n6MonthNumber: 6,
                },
                {
                    channel: 1,
                    type: '待确定时间',
                    n1MonthNumber: 1,
                    n2MonthNumber: 2,
                    n3MonthNumber: 3,
                    n4MonthNumber: 4,
                    n5MonthNumber: 5,
                    n6MonthNumber: 6,
                },
                {
                    channel: 1,
                    type: '待确定方案',
                    n1MonthNumber: 1,
                    n2MonthNumber: 2,
                    n3MonthNumber: 3,
                    n4MonthNumber: 4,
                    n5MonthNumber: 5,
                    n6MonthNumber: 6,
                },
                {
                    channel: 1,
                    type: '合计',
                    n1MonthNumber: 1,
                    n2MonthNumber: 2,
                    n3MonthNumber: 3,
                    n4MonthNumber: 4,
                    n5MonthNumber: 5,
                    n6MonthNumber: 6,
                },
                {
                    channel: 1,
                    type: '交付品种数',
                    n1MonthNumber: 1,
                    n2MonthNumber: 2,
                    n3MonthNumber: 3,
                    n4MonthNumber: 4,
                    n5MonthNumber: 5,
                    n6MonthNumber: 6,
                },
                {
                    channel: 1,
                    type: '满足率',
                    n1MonthNumber: 0.1,
                    n2MonthNumber: 0.2,
                    n3MonthNumber: 0.3,
                    n4MonthNumber: 0.4,
                    n5MonthNumber: 0.5,
                    n6MonthNumber: 0.6,
                }
            ],
            detailRates: []
        }
    ];
    res.json({
        message: '',
        payload: {
            content
        }
    });
});
module.exports = router;
